package com.siwei.mes.enums;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;

import java.util.Arrays;

/**
 * @Description: 物料类型枚举   字典表（MASTERIAL_TYPE）
 * @Version: 1.0
 * @author: chenmaolin
 * @date: 2023/12/23 22:16
 */
@Getter
public enum CementAdventEnum {
    CODE1("32.5", "3.0,12.0", "5.5,32.5"),
    CODE2("32.5R", "4.0,17.0", "5.5,32.5"),
    CODE3("42.5", "4.0,17.0", "6.5,42.5"),
    CODE4("42.5R", "4.5,22.0", "6.5,42.5"),
    CODE5("52.5", "4.5,22.0", "7.0,52.5"),
    CODE6("52.5R", "5.0,27.0", "7.0,52.5"),
    CODE7("62.5", "5.0,27.0", "8.0,62.5"),
    CODE8("62.5R", "5.5,32.0", "8.0,62.5");

    @ApiModelProperty(value = "强度等级")
    private String code;

    @ApiModelProperty(value = "3d 抗压强度,抗折强度")
    private String name;

    @ApiModelProperty(value = "28d 抗压强度,抗折强度")
    private String name2;

    CementAdventEnum(String code, String name, String name2) {
        this.code = code;
        this.name = name;
        this.name2 = name2;
    }

    /**
     * 根据code查找信息
     *
     * @param code 物料类型
     * @return
     */
    public static CementAdventEnum selectByCode(String code) {
        return Arrays.stream(values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }
}
